package com.yikome.purchase.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.yikome.common.CommonRepository;
import com.yikome.purchase.entity.Purchase;

@Repository
public interface PurchaseRepository extends CommonRepository<Purchase, Long>{

	@Query("select t from Purchase t where t.yn = 1 and t.purchaseCode = :purchaseCode")
	Purchase findPurchase(@Param("purchaseCode")String purchaseCode);
	
	@Query("select t from Purchase t where t.yn = 1 and t.status = :purchaseStatus")
	List<Purchase> findByStatus(@Param("purchaseStatus")Integer purchaseStatus);

}
